#ifndef _COLOR_QUANTIZATION_H_
#define _COLOR_QUANTIZATION_H_

#include "saliency.h"

void MedianSegAnyColorNew(float *xyz_data, int width, int height, int seg_label, unsigned char *out_data, ColorRange *cr);
void MedianCutAnyColorNew(float *xyz_data, int width, int height, unsigned char *out_data, RGBCluster *rgbcluster, ColorRange *cr);
void GetXYZClusterInfo(unsigned char *img_data, int width, int height, float *xyz_data, unsigned char *out_data, RGBCluster *rgbcluster);

int FindNearestClusterNew(RGBCluster *rgbcluster, float oc_a, float oc_b, float oc_c);
void CreateXYZClusterMap(unsigned char *img_data, unsigned char *out_data, int width, int height, RGBCluster *rgbcluster);

void RGB2XYZ(int r, int g, int b, float *x, float *y, float *z);
void GetXYZClusterInfoNew(unsigned char *img_data, int width, int height, float *xyz_data, unsigned char *out_data, RGBCluster *rgbcluster);
void CreateXYZClusterMapByOneD(float *xyz_data, unsigned char *out_data, int width, int height, RGBCluster *rgbcluster);
int FindNearestClusterNewByOneD(RGBCluster *rgbcluster, float oc_a, float oc_b, float oc_c);

#endif //_COLOR_QUANTIZATION_H_